<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>

<html>
<head>
<link rel="stylesheet" type="text/css" href="/hykj/css/header.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>产品大全</title>
<script type="text/javascript">
function changeUrl() {
	
	var x = document.getElementsByName("products");
	var url = "";
	var ur = "";
	for (i = 0; i < x.length; i++) {
		if (x[i].checked) {
			url += (x[i].value +",");
		}
		ur = url.substring(0,(url.lastIndexOf(",")));
	}
	document.getElementById("delete").action="/hykj/admin/products/deleteProduct?productId=(" + ur + ")";
	
}

function deleteProducts() {
	document.getElementById("delete").submit();
}
</script>
</head>
<body>
<center><jsp:include page="/admin/head.jsp">
	<jsp:param name="menu" value="products"></jsp:param></jsp:include>
<table width="944" border="0">
	<tr>
		<td align="left" width="655">
		<table width="655" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td bgcolor="#323232"><a href="/hykj/admin/products/shouye.jsp">首页产品</a>
				</td>
				<td bgcolor="#323232" align="right"><a
					href="/hykj/admin/products/insertProducts.jsp">新增</a>
				</td>
				<td bgcolor="#323232" align="right"><input type="button"
					onclick="deleteProducts()" value="删除"></input></td>
			</tr>
			<tr height="30">
				<td colspan="3" width="655" align="left" valign="top"><c:set
					var="allgoodslist" value="${requestScope.productsList}" /> <c:if
					test="${empty allgoodslist}">没有产品</c:if> <c:if
					test="${!empty allgoodslist}">
					<form id="delete" name="deleteform" action="" method="post">
					<table border="0" cellspacing="5" cellpadding="5">
						<c:forEach var="onegoods" items="${allgoodslist}">
							<tr>
								<c:if test="${!empty onegoods}">

									<td valign="top">${onegoods.front }<input
										onclick="changeUrl()" type="checkbox" name="products"
										value=${onegoods.id } /> <a
										href="/hykj/admin/products/viewProduct?productId=${onegoods.id}">${onegoods.title}</a><br>
									${onegoods.describes}<br>
									</td>
								</c:if>
							</tr>
						</c:forEach>
						<tr>
							<td bgcolor="#323232" colspan="4">${requestScope.pageBar.pageLink}</td>
						</tr>
					</table>
					</form>
				</c:if></td>
			</tr>
		</table>
		</td>
		<td valign="top">
		<table width="280" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td height="5"></td>
			</tr>
			<tr>
				<td width="280" height="42" style="background-color:#323232; text-align:left; text-indent:30px;"><strong>游戏平台&nbsp;&nbsp;Game PlatForm</strong>
				</td>
			</tr>
			<tr>
				<td align="left" width="280" 
				style="background-color:#323232;
				 border-style:solid; 
				 border-top-width:thin; 
				 border-bottom-color:#323232;
				 border-left-color:#323232;
				 border-right-color:#323232;
				 padding:8px;
				 ">
				&nbsp;&nbsp;&nbsp;<a
					href="/hykj/admin/products/getCategoryProducts?category=0">java</a><br />
				&nbsp;&nbsp;&nbsp;<a
					href="/hykj/admin/products/getCategoryProducts?category=1">Symbian</a><br />
				&nbsp;&nbsp;&nbsp;<a
					href="/hykj/admin/products/getCategoryProducts?category=2">iPhone</a><br />
				&nbsp;&nbsp;&nbsp;<a
					href="/hykj/admin/products/getCategoryProducts?category=3">Android</a><br />
				</td>
			</tr>
			<tr>
				<td width="280" height="14" style="background-color:#323232;"></td>
			</tr>
		</table>
		</td>
	</tr>
</table>



<jsp:include page="/admin/foot.jsp" /></center>
</body>
</html>